package com.lotto.manager.common.utils;

import java.util.Calendar;
import java.util.Date;

public class DateUtil {
	//根据日期取得星期几
	public static int getWeek(Date date){
		Integer[] weeks = {7,1,2,3,4,5,6};
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		int week_index = cal.get(Calendar.DAY_OF_WEEK) - 1;
		if(week_index<0){
			week_index = 0;
		} 
		return weeks[week_index];
	}
}
